<template>
  <div class="wrap">
    <div class="nav">
      <ul>
        <li @tap = "navigateBack">返回</li>
        <li>咨询频道</li>
        <li></li>
      </ul>
      </div>
    <div class="cont" v-for="(item,index) in list" :key = 'index'>
      <navigator url = '../detail/detail' target = "self">
        <dl>  
        <dt><img src="http://pic4.ajkimg.com/m/08d681fc49c1dd2156a185e9a209d056/275x206n.jpg" alt=""></dt>
        <dd>
          <p>{{item.title}}</p>
          <p class="date">{{item.date}}</p>
        </dd>
      </dl>   
      </navigator>
    </div>
  </div>
</template>

<script>
import {getInformationData} from '../../services'
export default {
   data(){
       return{
            list:[]
       }
   },
   async created(){
       let result = await getInformationData();
       if(result.status === 200){
         this.list = result.body
         console.log(this.list);
       }
   }, 
    methods:{
   navigateBack(){
     uni.navigateBack()
   }
  }
};
</script>

<style lang="scss" scoped>
.wrap {
  width: 100%;
  height: 100%;
  .nav {
    width: 100%;
    height: 200rpx;
    background: royalblue;
    margin-top: 60rpx;
    ul li {
      float: left;
      margin-left: 100rpx;
      color: #fff;
      line-height: 40rpx;
      text-align: center;
    }
  }
  .cont{
    width: 100%;
    height: 220rpx;   
    margin: 30rpx 0rpx 30rpx 30rpx;
    dl{
      width: 100%;
      dt{
        float: left;
        img{
          width: 300rpx;
          height: 200rpx;
        }
      }
      dd{
        float:left;
        margin-left: 315rpx;
        margin-top: -185rpx;
        .date{
          font-size: 28rpx;
          color: #333;
          margin-top: 20rpx; 
        }
}
      }
    }
  }

</style>